package com.atguigu.springbootmybatisplusrabbitmq.consumer;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class ConfirmConsumer {
    public static final String CONFIRM_QUEUE_NAME="confirm_queue";
//    @RabbitListener(queues = CONFIRM_QUEUE_NAME)
//    public void receiveMsg(Message message){
//        String msg = new String(message.getBody());
//        log.info("接受到队列confirm.queue消息：{}",msg);
//    }

    @RabbitListener(queues = ConfirmConsumer.CONFIRM_QUEUE_NAME)
    public void receiveConfirmMessage(Message message){
        String msg=new String(message.getBody());
        log.info("接收到的队列confirm.queue消息：{}",msg);
    }
}
